import React, { Fragment } from 'react';
import { Tabs } from 'antd';
import { history } from 'umi';
import QueryPage from '@/components/QueryPage';
import OvertimeRecord from './OvertimeRecord';
import BusinessRecord from './BusinessRecord';
import OutsideRecord from './OutsideRecord';

// 注释tab切换效果
const { TabPane } = Tabs;
const List = props => {
    const {
        location: { pathname }
    } = props;
    return (
        <Fragment>
            <QueryPage
                form={
                    <Tabs
                        activeKey={pathname}
                        onChange={key => {
                            history.push(key);
                        }}
                    >
                        <TabPane tab="加班记录" key="/office/personnelManagement/attendance/timetag/overrecord">
                            <OvertimeRecord activeKey={1} />
                        </TabPane>
                        <TabPane tab="出差记录" key="/office/personnelManagement/attendance/timetag/busirecord">
                            <BusinessRecord activeKey={2} />
                        </TabPane>
                        <TabPane tab="外出记录" key="/office/personnelManagement/attendance/timetag/outrecord">
                            <OutsideRecord activeKey={3} />
                        </TabPane>
                    </Tabs>
                }
            />
        </Fragment>
    );
};

export default List;
